<!DOCTYPE html>


<html lang="en">
  

    <head>
      <meta charset="utf-8" />
        
      <meta name="description" content="一个简单的blog" />
      
      <meta
        name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1"
      />
      <title> 早朝三鹰</title>
  <meta name="generator" content="hexo-theme-ayer">
      
      <link rel="shortcut icon" href="/favicon.ico" />
       
<link rel="stylesheet" href="/dist/main.css">

      
<link rel="stylesheet" href="/css/fonts/remixicon.css">

      
<link rel="stylesheet" href="/css/custom.css">
 
      <script src="https://cdn.staticfile.org/pace/1.2.4/pace.min.js"></script>
       
 

      <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/@sweetalert2/theme-bulma@5.0.1/bulma.min.css"
      />
      <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11.0.19/dist/sweetalert2.min.js"></script>

      <!-- mermaid -->
      
      <style>
        .swal2-styled.swal2-confirm {
          font-size: 1.6rem;
        }
      </style>
    </head>
  </html>
</html>


<body>
  <div id="app">
    
      
    <main class="content on">
      
<section class="cover">
    
      
      <a class="forkMe" href="https://github.com/Shen-Yu/hexo-theme-ayer"
        target="_blank"><img width="149" height="149" src="/images/forkme.png"
          class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1"></a>
    
  <div class="cover-frame">
    <div class="bg-box">
      <img src="/images/115746bqavf49pfx4zhczr.jpg" alt="image frame" />
    </div>
    <div class="cover-inner text-center text-white">
      <h1><a href="/">早朝三鹰</a></h1>
      <div id="subtitle-box">
        
        <span id="subtitle"></span>
        
      </div>
      <div>
        
      </div>
    </div>
  </div>
  <div class="cover-learn-more">
    <a href="javascript:void(0)" class="anchor"><i class="ri-arrow-down-line"></i></a>
  </div>
</section>



<script src="https://cdn.staticfile.org/typed.js/2.0.12/typed.min.js"></script>


<!-- Subtitle -->

  <script>
    try {
      var typed = new Typed("#subtitle", {
        strings: ['一个简单的垃圾回收站', '', ''],
        startDelay: 0,
        typeSpeed: 200,
        loop: true,
        backSpeed: 80,
        showCursor: true
      });
    } catch (err) {
      console.log(err)
    }
  </script>
  
<div id="main">
  <section class="outer">
  
  <ul class="ads">
    
        <li>
            <a target="_blank" rel="noopener" href="https://curl.qcloud.com/kvO7hb43">
                <img src="https://pic.imgdb.cn/item/62174b452ab3f51d912a5ccc.jpg" width="300" alt="云服务器限时秒杀">
            </a>
        </li>
    
        <li>
            <a target="_blank" rel="noopener" href="https://www.vultr.com/?ref=8630075">
                <img src="https://pic.imgdb.cn/item/62174b452ab3f51d912a5cd7.png" width="300" alt="vultr优惠vps">
            </a>
        </li>
    
</ul>
  
  
  

<div class="notice" style="margin-top:50px">
    <i class="ri-heart-fill"></i>
    <div class="notice-content" id="broad"></div>
</div>
<script type="text/javascript">
    fetch('https://v1.hitokoto.cn')
        .then(response => response.json())
        .then(data => {
            document.getElementById("broad").innerHTML = data.hitokoto;
        })
        .catch(console.error)
</script>

<style>
    .notice {
        padding: 20px;
        border: 1px dashed #e6e6e6;
        color: #969696;
        position: relative;
        display: inline-block;
        width: 100%;
        background: #fbfbfb50;
        border-radius: 10px;
    }

    .notice i {
        float: left;
        color: #999;
        font-size: 16px;
        padding-right: 10px;
        vertical-align: middle;
        margin-top: -2px;
    }

    .notice-content {
        display: initial;
        vertical-align: middle;
    }
</style>
  
  <article class="articles">
    
    
    
    
    <article
  id="post-基于hexo搭建博客"
  class="article article-type-post"
  itemscope
  itemprop="blogPost"
  data-scroll-reveal
>
  <div class="article-inner">
    
    <header class="article-header">
       
<h2 itemprop="name">
  <a class="article-title" href="/2023/10/26/%E5%9F%BA%E4%BA%8Ehexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/"
    >基于hexo搭建博客</a> 
</h2>
 

      
    </header>
     
    <div class="article-meta">
      <a href="/2023/10/26/%E5%9F%BA%E4%BA%8Ehexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/" class="article-date">
  <time datetime="2023-10-26T00:20:14.000Z" itemprop="datePublished">2023-10-26</time>
</a>    
    </div>
      
    <div class="article-entry" itemprop="articleBody">
       
  <h1 id="基于hexo搭建个人博客"><a href="#基于hexo搭建个人博客" class="headerlink" title="基于hexo搭建个人博客"></a>基于hexo搭建个人博客</h1><h1 id="搭建博客之前的准备"><a href="#搭建博客之前的准备" class="headerlink" title="搭建博客之前的准备"></a>搭建博客之前的准备</h1><h2 id="安装nodejs"><a href="#安装nodejs" class="headerlink" title="安装nodejs"></a>安装nodejs</h2><p>下载<a target="_blank" rel="noopener" href="http://nodejs.cn/download/">点击此处</a>（选择windows安装包64位）</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026084941897.png" alt="image-20231026084941897"></p>
<p>运行安装包，建议非C盘目录下，默认安装即可</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/gtd/Snipaste_2020-02-29_08-49-21.png" alt="img"></p>
<p>点击Next进入后，在这里选择最后一个（Add to PATH）</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/gtd/Snipaste_2020-02-29_08-49-39.png" alt="img"></p>
<h2 id="安装Git"><a href="#安装Git" class="headerlink" title="安装Git"></a>安装Git</h2><p>下载<a target="_blank" rel="noopener" href="https://git-scm.com/">点击此处</a></p>
<p>选择右下角安装即可</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026085514357.png" alt="image-20231026085514357"></p>
<p>运行安装包，选择自己喜欢的安装位置，点击Next</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/gtd/Snipaste_2020-02-29_09-01-49.png" alt="img"></p>
<p>后续步骤一直点击Next即可，无需多余配置</p>
<p><img src="https://i.loli.net/2020/02/29/jqTCDk6YSbwQOVz.png" alt="Snipaste_2020-02-29_09-02-25.png"></p>
<h2 id="验证nodejs是否安装配置完成"><a href="#验证nodejs是否安装配置完成" class="headerlink" title="验证nodejs是否安装配置完成"></a>验证nodejs是否安装配置完成</h2><p>安装完Git后，在桌面右键会有Git Bash Here，点开即可</p>
<p>（注：win11用户可在&#x3D;&#x3D;显示更多选项&#x3D;&#x3D;里找到）</p>
<p><img src="https://i.loli.net/2020/02/29/s1YhxtEILOlk4Xz.png" alt="Snipaste_2020-02-29_09-05-54.png"></p>
<p>点开会后出现一个终端，分别执行下面命令即可</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">node -v</span><br><span class="line">npm -v</span><br></pre></td></tr></table></figure>

<p>如果出现版本号即证明配置成功，反之失败。<img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/213.ophl1x6e4sp.png" alt="image"></p>
<p>失败请重新安装nodejs（检查是否勾选Addto PATH）或手动为nodejs添加环境变量</p>
<h3 id="环境变量的配置（配置失败手动添加）"><a href="#环境变量的配置（配置失败手动添加）" class="headerlink" title="环境变量的配置（配置失败手动添加）"></a>环境变量的配置（配置失败手动添加）</h3><ol>
<li><p>在安装目录下如<strong>D:\nodejs</strong>下新建两个文件夹<code>node_global</code>(全局包存放目录) 和 <code>node_cache</code>(缓存目录)</p>
</li>
<li><p>&#x3D;&#x3D;win+r&#x3D;&#x3D;输入cmd执行下面命令</p>
 <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">npm config set prefix &quot;D:\soft\nodejs\node_global&quot;</span><br><span class="line">npm config set cache &quot;D:\soft\nodejs\node_cache&quot;</span><br></pre></td></tr></table></figure>
</li>
<li><p>配置环境变量</p>
</li>
</ol>
<ul>
<li><p>打开系统属性-高级-环境变量，在系统变量中新建 变量名：<code>NODE_PATH</code>,变量值：<code>D:\soft\nodejs\node_global\node_modules</code><img src="https://pic2.zhimg.com/80/v2-2af4b8daba4fa52b22d52bd4a40f4ea9_1440w.webp" alt="img"></p>
</li>
<li><p>编辑用户变量的 <code>path</code>，将默认的 <code>C</code> 盘下 <code>APPData/Roaming\npm</code> 修改为 <code>D:\soft\nodejs\node_global</code><img src="https://pic1.zhimg.com/v2-0acd44f52be746f0be650f6371f895a4_r.jpg" alt="img"></p>
</li>
<li><p>保存即可</p>
</li>
</ul>
<h2 id="安装cnpm"><a href="#安装cnpm" class="headerlink" title="安装cnpm"></a>安装cnpm</h2><p>在Git Bash中执行下面命令</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g cnpm --registry=https://registry.npm.taobao.org</span><br></pre></td></tr></table></figure>

<p><strong>检查cpnm是否安装成功</strong></p>
<p>执行下面命令</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm -v </span><br></pre></td></tr></table></figure>

<p>出现版本号即为安装成功</p>
<h1 id="安装hexo并初始化博客"><a href="#安装hexo并初始化博客" class="headerlink" title="安装hexo并初始化博客"></a>安装hexo并初始化博客</h1><h2 id="安装hexo"><a href="#安装hexo" class="headerlink" title="安装hexo"></a>安装hexo</h2><p>在Git Bash中执行下面命令</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm install hexo-cli -g</span><br></pre></td></tr></table></figure>

<h2 id="初始化博客"><a href="#初始化博客" class="headerlink" title="初始化博客"></a>初始化博客</h2><p>选择一个文件夹，右键打开Git Bash<br>例如：我在F盘新建了一个blog文件夹，就在blog文件夹下打开git bash</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_09-23-38.xgw9p9u10qr.png" alt="image"></p>
<p>然后这里会显示你当前目录</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_09-25-37.w75xfc7uqwj.png" alt="image"></p>
<p>然后执行</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo init</span><br></pre></td></tr></table></figure>

<p>到&#x3D;&#x3D;Install dependencies&#x3D;&#x3D;的时候你可能会卡住，这是大多数人基本都会遇到的</p>
<p>我们只需要在这里的时候结束命令，按&#x3D;&#x3D;Ctrl + c&#x3D;&#x3D;就可以结束命令</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_09-27-37.79mebxnx3oa.png" alt="image"></p>
<p>然后执行下面这个命令，就可以使用国内的镜像为你完成博客的初始化工作</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm install</span><br></pre></td></tr></table></figure>

<p>然后继续<br>等待命令完成后，就完成了初始化，可以预览博客了</p>
<p>执行下面命令<br>&#x3D;&#x3D;注：此时不要结束命令和关闭终端&#x3D;&#x3D;</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure>

<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_09-31-47.jmi628mj35e.png" alt="image"></p>
<p>出现了一段http开头的网站，这个就是你的预览网站<br>复制到浏览打开，就会出现这个画面</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_09-33-55.tyszma65r9.png" alt="image"></p>
<h1 id="更换你的博客主题"><a href="#更换你的博客主题" class="headerlink" title="更换你的博客主题"></a>更换你的博客主题</h1><p>相信很多人都会觉得默认主题不好看<br>所以现在可以配置自己喜欢的主题</p>
<p>hexo的所有主题都在<a target="_blank" rel="noopener" href="https://hexo.io/themes/">这</a></p>
<p>你可以在这里挑自己喜欢的主题</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026094055175.png" alt="image-20231026094055175"></p>
<p>粗体蓝字就是主题的来源（一般为github的，国内局域网可能会难以登录）<br>你可以使用<strong>魔法</strong>上网也可以使用&#x3D;&#x3D;steam++&#x3D;&#x3D;和&#x3D;&#x3D;UU加速器&#x3D;&#x3D;进行加速</p>
<p>浅体蓝字则是预览，你可以点击查看主题的具体样式</p>
<p>&#x3D;&#x3D;注意每个主题都有不同的配置方法请严格按照主题所给进行配置&#x3D;&#x3D;</p>
<p>我们要找一个功能齐全，配置简单的主题练练手</p>
<p>就是这个新手入门hexo必备的Next主题<br><a target="_blank" rel="noopener" href="https://theme-next.org/">预览效果</a>               <a target="_blank" rel="noopener" href="https://github.com/theme-next/hexo-theme-next">项目地址</a>             <a target="_blank" rel="noopener" href="https://theme-next.org/docs/getting-started/">配置文档</a></p>
<h2 id="如何下载主题"><a href="#如何下载主题" class="headerlink" title="如何下载主题"></a>如何下载主题</h2><h3 id="方法一"><a href="#方法一" class="headerlink" title="方法一"></a>方法一</h3><p>打开主题的项目地址后，点击<code>Clone or download</code></p>
<p>然后复制https开头的地址</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_09-46-02.gnmyl5b7s2.png" alt="image"></p>
<p>然后在博客文件夹根目录里打开Git Bash</p>
<p>执行下面命令</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git clone 复制的地址 themes/主题名字</span><br></pre></td></tr></table></figure>

<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_09-50-23.o7ukcdqwa8e.png" alt="image"></p>
<h3 id="方法二"><a href="#方法二" class="headerlink" title="方法二"></a>方法二</h3><p>打开主题项目地址，然后点击<code>Clone or download</code>，然后点击Download ZIP</p>
<p>这样可以下载主题文件压缩包，前提是你已经登入了github（没有账号的，请自己注册一下）&#x3D;&#x3D;[国内局域网可能下载较慢]&#x3D;&#x3D;</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_09-53-14.hd54gibpilh.png" alt="image"></p>
<p>然后解压压缩包，把文件夹放在博客目录下的themes目录，并把文件夹命名为主题的名字</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_09-56-33.xhx8o5z5d9.png" alt="image"></p>
<h2 id="修改配置文件"><a href="#修改配置文件" class="headerlink" title="修改配置文件"></a>修改配置文件</h2><p>在博客的目录下有一个叫<code>_config.yml</code>的文件</p>
<p>将它打开</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026095410348.png" alt="image-20231026095410348"></p>
<p>找到<code>themes</code>这一行，然后将主题名字修改为next</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_10-02-23.58o49hkjdki.png" alt="image"></p>
<p>&#x3D;&#x3D;记得一定要保存！！！&#x3D;&#x3D;</p>
<h2 id="预览主题"><a href="#预览主题" class="headerlink" title="预览主题"></a>预览主题</h2><p>在博客目录里打开Git Bash</p>
<p>执行</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure>

<p>还是会出现一段浏览地址，我们在浏览器打开就行了，就可以看到你的预览网站</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_10-04-16.2dvd68y21dm.png" alt="image"></p>
<h1 id="配置主题-这个请严格按照你选择的主题进行配置-不同主题配置方法不同"><a href="#配置主题-这个请严格按照你选择的主题进行配置-不同主题配置方法不同" class="headerlink" title="配置主题&#x3D;&#x3D;这个请严格按照你选择的主题进行配置(不同主题配置方法不同)&#x3D;&#x3D;"></a>配置主题&#x3D;&#x3D;这个请严格按照你选择的主题进行配置(不同主题配置方法不同)&#x3D;&#x3D;</h1><p>我们需要认识两个文件</p>
<ul>
<li>站点配置文件</li>
</ul>
<p>指的是博客根目录下的<code>_config.yml</code><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_10-01-51.gwst228nama.png" alt="image"></p>
<ul>
<li>主题配置文件</li>
</ul>
<p>指的是某个主题下的<code>_config.yml</code></p>
<p>它们的名字都叫<code>_config.yml</code>但是你不能弄混淆</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_10-11-13.qayjeoclrer.png" alt="image"></p>
<p>在我们看主题文档配置的时候，是必须要分清这两个概念的，不然会报错</p>
<p>我们先来几个基本的配置</p>
<p>&#x3D;&#x3D;修改请根据你选择的主题内进行配置&#x3D;&#x3D;</p>
<p>配置好后，打开博客根目录，运行Git Bash</p>
<p>执行下列命令</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure>

<p>来查看是否配置成功</p>
<h1 id="生成文章"><a href="#生成文章" class="headerlink" title="生成文章"></a>生成文章</h1><h2 id="创建blog文章"><a href="#创建blog文章" class="headerlink" title="创建blog文章"></a>创建blog文章</h2><p>在博客根目录中</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_10-01-51.gwst228nama.png" alt="image"></p>
<p>执行下列命令</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new &quot;文章标题&quot;</span><br></pre></td></tr></table></figure>

<p>例如你想创建一个名为“我的第一篇blog”</p>
<p>输入 hexo new ”我的第一篇blog“即可</p>
<h2 id="编辑blog"><a href="#编辑blog" class="headerlink" title="编辑blog"></a>编辑blog</h2><p>生成的文件是一个.md后缀的文件<br>是一个markdown的文件，需要markdown文件编辑器编辑（当然也可以使用记事本)<br>Typora是一个很好的编译器不过收费（要爆米70块）</p>
<p>在博客根目录的source文件夹中</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026130009931.png" alt="image-20231026130009931"></p>
<p>可以看到_posts的文件夹</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026130101825.png" alt="image-20231026130101825"></p>
<p>你所创建的.md文件就在里面，打开文件可以看到横线上的信息</p>
<p>这是你博客信息的地方</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_12-16-37.oun3i88bw.png" alt="image"></p>
<ul>
<li>title 文章标题</li>
<li>date 文章日期</li>
<li>tag 文章标签</li>
</ul>
<p>然后这时候你可以修改文章标题，并且在横线下面输入你文章的内容</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_12-17-14.7x7sfa9t9m8.png" alt="image"></p>
<p>保存好后，在博客根目录打开Git Bash</p>
<p>执行</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure>

<p>就会出现你的文章了</p>
<h1 id="部署你的博客"><a href="#部署你的博客" class="headerlink" title="部署你的博客"></a>部署你的博客</h1><p>有两种方法</p>
<h2 id="1-GitHub部署"><a href="#1-GitHub部署" class="headerlink" title="1.GitHub部署"></a>1.GitHub部署</h2><ul>
<li>国外网站，是英文</li>
<li>访问速度较慢</li>
<li>不需要实名认证</li>
<li>域名形式可以自定义</li>
</ul>
<p> 前提是必须有一个GitHub的账号（前面也提及了GitHub国内局域网难以登录，需使用魔法或者加速器登录）</p>
<p>打开后点击头像<img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026130941939.png" alt="image-20231026130941939"></p>
<p>点开仓库</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026131043083.png" alt="image-20231026131043083"></p>
<p>创建一个新的仓库</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026131118343.png" alt="image-20231026131118343"></p>
<p>之后按照下面填写（将我的用户名替换成你的用户名）</p>
<p>&#x3D;&#x3D;仓库名的前缀一定要和你的用户名保持一致之后加入**.github.io**&#x3D;&#x3D;</p>
<p>我已经创建过这个仓库了所以提示错误</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026131343242.png" alt="image-20231026131343242"></p>
<p>接下来需要创建密钥</p>
<p>打开git bash （不要求在哪个目录）</p>
<p>执行（输入你的邮箱&#x3D;&#x3D;引号不要忘记&#x3D;&#x3D;）</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -t rsa -C “your_email@youremail.com“</span><br></pre></td></tr></table></figure>

<p>不管出现什么信息，回车就好</p>
<p>然后继续执行</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat ~/.ssh/id_rsa.pub</span><br></pre></td></tr></table></figure>

<p>会出现一大串英文复制就好</p>
<p>然后点击头像进入设置</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026131736545.png" alt="image-20231026131736545"></p>
<p>然后进入ssh和gpg</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026131833303.png" alt="image-20231026131833303"></p>
<p>创建一个ssh密钥</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026131931968.png" alt="image-20231026131931968"></p>
<p>将你复制的密钥输入进大方块中</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026132010566.png" alt="image-20231026132010566"></p>
<p>添加即可</p>
<p>然后打开git bash，执行</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh -T git@github.com</span><br></pre></td></tr></table></figure>

<p>会提示你下面这个，输入yes回车就行了</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Are you sure you want to continue connecting (yes/no/[fingerprint])? </span><br></pre></td></tr></table></figure>

<p>打开项目，点击绿色按钮，点击Use SSH</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_15-01-31.omf9nqgs46i.png" alt="image"></p>
<p>复制git开头的地址<img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_15-01-38.kjtg51f14z.png" alt="image"></p>
<p>打开站点配置文件</p>
<p>修改deploy信息</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">deploy:</span><br><span class="line">  type: git</span><br><span class="line">  repo: 你复制的地址</span><br><span class="line">  branch: master</span><br></pre></td></tr></table></figure>

<p>在博客根目录下打开git bash</p>
<p>分别执行下面的命令：</p>
<p>yourname是你的用户名</p>
<p>youremail是你的邮箱</p>
<p>&#x3D;&#x3D;（引号不要忘记）&#x3D;&#x3D;</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">git config --global user.name &quot;yourname&quot;</span><br><span class="line">git config --global user.email &quot;youremail&quot;</span><br></pre></td></tr></table></figure>

<p>然后安装上传插件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm install hexo-deployer-git --save</span><br></pre></td></tr></table></figure>

<p>然后修改你的博客并部署</p>
<p>执行</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo g -d</span><br></pre></td></tr></table></figure>

<p>出现这个即为成功</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_12-49-05.lkmgvzcdzwh.png" alt="image"></p>
<p>然后打开项目，点击Settings</p>
<p><img src="https://cdn.jsdelivr.net/gh/kjhuanhao/blogcdn/img/Snipaste_2020-02-29_15-07-19.prpi9gjzgvn.png" alt="image"></p>
<p>往下滑找到Github pages修改成此</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026132546923.png" alt="image-20231026132546923"></p>
<p>之后你就会得到一个地址这个就是你博客的地址了</p>
<p><img src="C:/Users/鶄/AppData/Roaming/Typora/typora-user-images/image-20231026132627784.png" alt="image-20231026132627784"></p>
<h2 id="2-国内网站部署"><a href="#2-国内网站部署" class="headerlink" title="2.国内网站部署"></a>2.国内网站部署</h2> 
      <!-- reward -->
      
    </div>
    

    <!-- copyright -->
    
    <footer class="article-footer">
       
    </footer>
  </div>

   
   
  
</article>

    
  </article>
  

  
</section>
</div>

      <footer class="footer">
  <div class="outer">
    <ul>
      <li>
        Copyrights &copy;
        2015-2023
        <i class="ri-heart-fill heart_icon"></i> John Doe
      </li>
    </ul>
    <ul>
      <li>
        
      </li>
    </ul>
    <ul>
      <li>
        
        
        <span>
  <span><i class="ri-user-3-fill"></i>Visitors:<span id="busuanzi_value_site_uv"></span></span>
  <span class="division">|</span>
  <span><i class="ri-eye-fill"></i>Views:<span id="busuanzi_value_page_pv"></span></span>
</span>
        
      </li>
    </ul>
    <ul>
      
    </ul>
    <ul>
      
    </ul>
    <ul>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>    
    </main>
    <div class="float_btns">
      <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>

<div class="todark" id="todark">
  <i class="ri-moon-line"></i>
</div>

    </div>
    <aside class="sidebar on">
      <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer.svg" alt="早朝三鹰"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/archives">归档</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/categories">分类</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E6%97%85%E8%A1%8C/">旅行</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" target="_blank" rel="noopener" href="http://shenyu-vip.lofter.com">摄影</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/friends">友链</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/2019/about">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
    </aside>
    <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
    
<script src="/js/jquery-3.6.0.min.js"></script>
 
<script src="/js/lazyload.min.js"></script>

<!-- Tocbot -->

<script src="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.js"></script>
<link
  rel="stylesheet"
  href="https://cdn.staticfile.org/jquery-modal/0.9.2/jquery.modal.min.css"
/>
<script src="https://cdn.staticfile.org/justifiedGallery/3.8.1/js/jquery.justifiedGallery.min.js"></script>

<script src="/dist/main.js"></script>

<!-- ImageViewer -->
 <!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.staticfile.org/photoswipe/4.1.3/default-skin/default-skin.min.css">
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="https://cdn.staticfile.org/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script> 
<!-- MathJax -->

<!-- Katex -->

<!-- busuanzi  -->
 
<script src="/js/busuanzi-2.3.pure.min.js"></script>
 
<!-- ClickLove -->

<!-- ClickBoom1 -->

<!-- ClickBoom2 -->

<!-- CodeCopy -->
 
<link rel="stylesheet" href="/css/clipboard.css">
 <script src="https://cdn.staticfile.org/clipboard.js/2.0.10/clipboard.min.js"></script>
<script>
  function wait(callback, seconds) {
    var timelag = null;
    timelag = window.setTimeout(callback, seconds);
  }
  !function (e, t, a) {
    var initCopyCode = function(){
      var copyHtml = '';
      copyHtml += '<button class="btn-copy" data-clipboard-snippet="">';
      copyHtml += '<i class="ri-file-copy-2-line"></i><span>COPY</span>';
      copyHtml += '</button>';
      $(".highlight .code pre").before(copyHtml);
      $(".article pre code").before(copyHtml);
      var clipboard = new ClipboardJS('.btn-copy', {
        target: function(trigger) {
          return trigger.nextElementSibling;
        }
      });
      clipboard.on('success', function(e) {
        let $btn = $(e.trigger);
        $btn.addClass('copied');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-checkbox-circle-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPIED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-checkbox-circle-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
      clipboard.on('error', function(e) {
        e.clearSelection();
        let $btn = $(e.trigger);
        $btn.addClass('copy-failed');
        let $icon = $($btn.find('i'));
        $icon.removeClass('ri-file-copy-2-line');
        $icon.addClass('ri-time-line');
        let $span = $($btn.find('span'));
        $span[0].innerText = 'COPY FAILED';
        
        wait(function () { // 等待两秒钟后恢复
          $icon.removeClass('ri-time-line');
          $icon.addClass('ri-file-copy-2-line');
          $span[0].innerText = 'COPY';
        }, 2000);
      });
    }
    initCopyCode();
  }(window, document);
</script>
 
<!-- CanvasBackground -->

<script>
  if (window.mermaid) {
    mermaid.initialize({ theme: "forest" });
  }
</script>


    
    

  </div>
</body>

</html>